<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

include_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/engine/start.php');

include_once(dirname(dirname(__FILE__)) . '/_init.php');

$user = get_user_by_username('greengar');
login($user);

$mocks = array(
    "Greengar" => array("Company", "http://www.facebook.com/pages/GreenGar-Studios/154764629596"),
    "Google" => array("Company", "http://www.facebook.com/pages/Google/123208247698110"),
    "Jet Propulsion Laboratory (JPL)" => array("Company", "http://www.facebook.com/NASAJPL"),
    "World Trekker" => array("Blog", "http://designbit.co.uk/wp-content/uploads/2010/12/wordpress_logo.png"),
    "University of Southern California" => array("University", "http://talkincollegefootball.com/wp-content/uploads/2010/08/usc_logo1.jpg"),
    "Walnut High School" => array("High School", "http://www.whsasb.com/whsasb/beauty/images/logoooooofelschoool.jpg"),
    "Swimming" => array("Sport", "http://1.bp.blogspot.com/_AcBUSVxs82w/SXcZAK0fYKI/AAAAAAAAQWw/ed72TXBtMJ0/s400/Swimming_Symbol.gif"),
    "Tennis" => array("Sport", "http://www.optics.rochester.edu/users/dingli/PersonalInfo_files/tennis_racket.gif")
);

foreach($mocks as $key => $value) {
    $name = $key;
    $annotation = array(
        "category" => $value[0],
        "image_url" => $value[1]
    );
    $annotation = json_encode($annotation);
    $rating = 2;
    $interest = array(
        INTEREST_NAME => $name,
        INTEREST_ANNOTATION => $annotation,
        INTEREST_RATING_INTEREST_RATING => $rating);

    $ratingEntity = greengar_opinions_add_interest($interest, get_loggedin_userid());
    
    if($ratingEntity) {
        echo json_encode($ratingEntity->toArray()) . '<br>';
    } else {
        echo "Fail " . json_encode($interest) . '<br>';
    }
}

?>
